package wedaex.content;

import org.apache.commons.lang.StringUtils;

public abstract class ContentExtractorBase implements ContentExtractor {
	protected String name;
	protected ContentSource contentSource;
	public ContentExtractorBase(String name, ContentSource contentSource) {
		this.name = name;
		this.contentSource = contentSource;
	}
	public ContentSource getContentSource() {
		return contentSource;
	}
	public String getName() {
		return name;
	}
	public int hashCode() {
		return this.name.hashCode();
	}
	public boolean equals(Object o) {
		if(!(o instanceof ContentExtractor)) return false;
		ContentExtractor that = (ContentExtractor) o;
		return StringUtils.equals(this.getName(), that.getName());
	}

	public int compareTo(ContentExtractor that) {
		return this.getName().compareTo(that.getName());
	}
}
